import { http } from "@/utils/http";
import { baseURLApi, type resResult } from "./utils";

type blogConfig = {
  id?: number;
  blogName: string;
  blogAvatar: string;
  avatarBg: string;
  personalSay: string;
  blogNotice: string;
  qqLink: string;
  weChatLink: string;
  githubLink: string;
  giteeLink: string;
  weChatGroup: string;
  qqGroup: string;
  mail: string;
  createTime: Date;
  updateTime: Date;
};
// 文章统计数据
type staticResult = {
  articleCount: number;
  tagCount: number;
  categoryCount: number;
};

export const getBlogConfig = () => {
  return http.request<resResult<blogConfig>>(
    "get",
    baseURLApi("/config/getConfig"),
    {}
  );
};

export const getBlogStatistic = () => {
  return http.request<resResult<staticResult>>(
    "get",
    baseURLApi("/config/getStatic"),
    {}
  );
};
